import { ECSComponent } from "../../../3rd/ECS/ECSComponent";
import { ECSEntity } from "../../../3rd/ECS/ECSEntity";
import { ecsclass } from "../../../3rd/ECS/__private";
import { BarrierFactorySystem } from "../systems/BarrierFactorySystem";
import { BarrierSystem } from "../systems/BarrierSystem";
import { EatSystem } from "../systems/EatSystem";
import { MovableSystem } from "../systems/MovableSystem";
import { PositionSystem } from "../systems/PositionSystem";
import { StarFactorSystem as StarFactorySystem } from "../systems/StarFactorySystem";


export enum GameState
{
    None,
    GameStart,
    GamePause,
    GameOver,
}

ecsclass("GameComponent")
export class GameComponent extends ECSComponent {

    public _gameState:GameState = GameState.None; //优化参数,防止系统每帧都在设置值
    public gameState:GameState = GameState.None;
    public player:ECSEntity = new ECSEntity("player");
    public moveSys:MovableSystem = new MovableSystem();
    public starFactorySys:StarFactorySystem = new StarFactorySystem();
    public eatSystem: EatSystem = new EatSystem();
    public positionSystem:PositionSystem = new PositionSystem();
    public barrierFactorySystem:BarrierFactorySystem = new BarrierFactorySystem();
    public barrierSystem:BarrierSystem = new BarrierSystem();

    public gameFrame:number = 0;
}